package com.practicario.mvc.view
{
    import com.practicario.mvc.ApplicationFacade;
    import com.practicario.mvc.view.components.Login;
    
    import flash.events.Event;
    
    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.mediator.Mediator;
    
    public class LoginMediator extends Mediator implements IMediator
    {
        public static const NAME:String = "LoginMediator";
        
		public function LoginMediator( viewComponent:Login ) 
        {
            super( NAME, viewComponent );
            app.addEventListener(Login.DO_LOG_IN, onDoLogIn);           				
        }
        
        private function onDoLogIn(e:Event):void
        {
        	sendNotification(ApplicationFacade.DO_LOG_IN, app.loginVO);
        }      

        override public function listNotificationInterests():Array 
        {
            return [
						
					];
        }

        override public function handleNotification( note:INotification ):void 
        {
            switch ( note.getName() ) 
			{
				
            }
        }

        protected function get app():Login
		{
            return viewComponent as Login;
        }
    }
}